package org.school.service;

import com.github.pagehelper.PageInfo;
import org.school.entity.*;
import org.school.staticException.PasswordIncorrectException;
import org.school.staticException.UserNotFoundException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.List;

/**
 * (User)表服务接口
 *
 * @author skyme
 * @since 2022-12-29 00:52:20
 */
public interface UserService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    User queryById(Integer id);

    /**
     * 分页查询
     *
     * @param user 筛选条件
     * @param pageRequest      分页对象
     * @return 查询结果
     */
    Page<User> queryByPage(User user, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param user 实例对象
     * @return 实例对象
     */
    User insert(User user);

    /**
     * 修改数据
     *
     * @param user 实例对象
     * @return 实例对象
     */
    User update(User user);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Integer id);
message login(String username, String password) throws UserNotFoundException, PasswordIncorrectException, NoSuchAlgorithmException;



    message register(User user) throws NoSuchAlgorithmException;

    int order(Dingdan dd);

    List<Dingdan> querryOrderByUser(String name);

    int completeOrderByUser(String name, Date date,String staus,int id);
    List<Shop> queryShopInfo();
    List<Shop> queryListShopInfo(String name);//模糊查询
    PageInfo<Shop> findShopInfo(int pageNum, int size);

    PageInfo<Shop> findListShopInfo(String name,int pageNum, int size);//模糊查询
}
